<%@ page language="java" contentType="text/html; charset=UTF-8"
	isELIgnored="false" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib uri="/mytag" prefix="yjd"%>
<div class="wrap">
	<div class="h_a">搜索</div>
	<div class="search_type cc mb10">
		<form method="get" action='<yjd:url url="/db/biEtlFromtableTotable/list"/>' autocomplete="off">
			<label>来源库：</label>
			<select	name="from_database_info_id" class="mr10">
				<option value="">全部</option>
				<c:forEach items="${requestScope.biDatabaseInfoModels }" var="item">
				<c:if test="${item.bs_type==1 }">
				<option ${param.from_database_info_id==item.id?"selected='selected'":"" } value="${item.id }">${item.title }</option>
				</c:if>
				</c:forEach>
			</select>
			<label>目标库：</label>
			<select	name="to_database_info_id" class="mr10">
				<option value="">全部</option>
				<c:forEach items="${requestScope.biDatabaseInfoModels }" var="item">
				<c:if test="${item.bs_type==2 }">
				<option ${param.to_database_info_id==item.id?"selected='selected'":"" } value="${item.id }">${item.title }</option>
				</c:if>
				</c:forEach>
			</select>
			<label>是否在抽取中：</label>
			<select	name="is_activie" class="mr10">
				<option value="">全部</option>
				<option ${param.is_activie==1?"selected='selected'":"" } value="1">是</option>
				<option ${param.is_activie==0?"selected='selected'":"" } value="0">否</option>
			</select>
			<button type="submit" class="btn btn_red">搜索</button>
		</form>
	</div>
	<div class="mb10">
		<a class="btn" href="<yjd:url url="/db/biEtlFromtableTotable/add"/>"><span class="add"></span>添加</a>
	</div>
	<!-- 列表 -->
	<c:set var="hashData" value="${pager.pagerModel.dataList!=null && fn:length(pager.pagerModel.dataList)>0 }" />
	<div class="table_list">
		<table width="100%">
			<thead>
				<tr>
					<td width="60">ID</td>
					<td>来源库</td>
					<td>来源表</td>
					<td>目标库</td>
					<td>目标表</td>
					<td>是否在抽取中</td>
					<td>已抽取最大的主键值</td>
					<td>操作 </td>
				</tr>
			</thead>
			<c:if test="${hashData }">
			<tbody>
			<c:forEach items="${pager.pagerModel.dataList }" var="item">
				<!-- 来源表 -->
				<c:set var="fromTable" value="${requestScope.biTableInfoMap[item.from_table_id] }"/>
				<!-- 目标表 -->
				<c:set var="toTable" value="${requestScope.biTableInfoMap[item.to_table_id] }"/>
				<!-- 来源库 -->
				<c:set var="fromDb" value="${requestScope.biDatabaseInfoMap[fromTable.database_info_id] }"/>
				<!-- 目标库 -->
				<c:set var="toDb" value="${requestScope.biDatabaseInfoMap[toTable.database_info_id] }"/>
				<tr>
					<td>${item.id }</td>
					<td>${fromDb.title }</td>
					<td>${fromTable.table_name }【${fromTable.description }】</td>
					<td>${toDb.title }</td>
					<td>${toTable.table_name }【${toTable.description }】</td>
					<td>${item.is_activie==0?"否":"<font color='red'>是</font>" }</td>
					<td>${item.etl_all_max_uq_value }</td>
					<td>
						<a href="<yjd:url url="/db/biEtlFromtableTotable/setIsActive/${item.id }/${item.is_activie==0?1:0 }"/>" class="btn J_ajax_del" data-msg='您确定${item.is_activie==0?"开启":"关闭" }抽取?' id="J_ajax_del_${item.id }">${item.is_activie==0?"开启":"关闭" }抽取</a>
						<a href="<yjd:url url="/db/biEtlFromtableTotable/delete/${item.id }"/>" class="btn J_ajax_del" msg="您确定删除该数据?" id="J_ajax_del_${item.id }">删除</a>
					</td>
				</tr>
			</c:forEach>
			</tbody>
			</c:if>
		</table>
	</div>
	<!-- 分页 -->
	<%@ include file="../../public/pager/pager.pagination.jsp" %>
</div>
<script>
	YJD.use('AppAdminCommon');
</script>